package com.marktotop.learntwo.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Properties;

/**
 * @author WXLD
 * @data 2021/4/18 - 7:33
 */
public class BookDaoImpl implements BookDao {

    // 定义五种特殊的类型属性，进行注入
    private ArrayList al;
    private Properties properties;
    private int[] arr;
    private HashSet set;
    private HashMap map;

    // 提供相应的set方法
    public void setAl(ArrayList al) {
        this.al = al;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public void setArr(int[] arr) {
        this.arr = arr;
    }

    public void setSet(HashSet set) {
        this.set = set;
    }

    public void setMap(HashMap map) {
        this.map = map;
    }

    // 进行调用
    @Override
    public void save() {
        System.out.println("Book Dao Run....");
        System.out.println("ArrayList:"+al);
        System.out.println("Properties:"+properties);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println("HashSet:"+set);
        System.out.println("HashMap:"+map);
    }
}
